<include file="Public/ace_header" />
    <div class="row">
        <form class="form-horizontal" role="form" method="post"  style="padding-left: 10px;padding-right: 10px;">
            <!-- <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="grade_id"> 所在年级 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <select name="grade_id" id="grade_id" class="width-100">
                            <volist name="grade" id="vo">
                            <option value="{$vo['id']}" <if condition ="$model['grade_id'] eq $vo['id']"> selected </if>>{$vo['name']}</option>
                            </volist>
                    
                        </select>
                        <i class=""></i>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>
            </div>
                    
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="major_id"> 所属专业 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <select name="major_id" id="major_id" class="width-100">
                            <volist name="major" id="vo">
                            <option value="{$vo['id']}" <if condition ="$model['major_id'] eq $vo['id']"> selected </if>>{$vo['name']}</option>
                            </volist>
                    
                        </select>   
                        <i class=""></i>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>
            </div>
                     -->
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="class_id"> 所在班级 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <select name="class_id" id="class_id" class="width-100">
                            <volist name="class" id="vo">
                            <php>$class=D('class')->find($vo['id'])</php>
                            <option value="{$vo['id']}" <if condition ="$model['class_id'] eq $vo['id']"> selected </if>>{:D('Grade')->where(['id'=>$class['grade_id']])->find()['name']}{:D('Major')->where(['id'=>$class['major_id']])->find()['name']}{$vo['name']}</option>
                            </volist>
                    
                        </select>
                        <i class=""></i>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>
            </div>
                    
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="name"> 姓名 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <input type="text" class="width-100" placeholder="姓名" id="name" name="name"  value="{$model['name']|default=''}" validate-required="required:请填写姓名"/>
                        <i class=""></i>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>

            </div>
                    
           <!--  <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="number"> 学号 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <input type="text" class="width-100" placeholder="学号" id="number" name="number"  value="{$model['number']|default=''}" validate-required="required:请填写学号"/>
                        <i class=""></i>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>

            </div> -->
                    
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="sex"> 性别 </label>
                <div class="col-xs-12 col-sm-6">
                    <select name="sex" id="sex" class="width-100 find-select">
                                <option value="男" <if condition ="$model['sex'] eq '男'"> selected </if>>男</option>
                                <option value="女" <if condition ="$model['sex'] eq '女'"> selected </if>>女</option>
                            </select>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>

            </div>
                    
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="age"> 年龄 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <input type="text" class="width-100"  id="age" name="age"  value="{$model['age']|default=''}">
                        <i class=""></i>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>

            </div>
                    
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="site"> 地址 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <input type="text" class="width-100"  id="site" name="site"  value="{$model['site']|default=''}">
                        <i class=""></i>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>

            </div>
                    
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="identity"> 身份证号 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <input type="text" class="width-100" placeholder="身份证号" id="identity" name="identity"  value="{$model['identity']|default=''}" validate-required="required:请填写身份证号"/>
                        <i class=""></i>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>

            </div>
                    
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="remark"> 备注 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <input type="text" class="width-100" " id="remark" name="remark"  value="{$model['remark']|default=''}">
                        <i class=""></i>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>

            </div>
                    
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="state"> 学生状态 </label>
                <div class="col-xs-12 col-sm-6">
                    <select name="state" id="state" class="width-100 find-select">
                                <option value="正常" <if condition ="$model['state'] eq '正常'"> selected </if>>正常</option>
                                <option value="退学" <if condition ="$model['state'] eq '退学'"> selected </if>>退学</option>
                                <option value="转学" <if condition ="$model['state'] eq '转学'"> selected </if>>转学</option>
                                <option value="休学" <if condition ="$model['state'] eq '休学'"> selected </if>>休学</option>
                            </select>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>

            </div>
                    
            <div class="clearfix form-actions">
                <div style="margin-left: 25%;">
                    <button class="btn btn-info btn-sm" type="submit">
                        <i class="icon-ok bigger-110"></i>
                        提交
                    </button>
                    &nbsp; &nbsp; &nbsp;
                    <button class="btn btn-sm return" type="button">
                        <i class="icon-reply bigger-110"></i>
                        返回
                    </button>
                    <if condition="ACTION_NAME eq StudentC">
                    &nbsp; &nbsp; &nbsp;
                    <button class="btn btn-success btn-sm" type="button" onclick="read()">
                        <i class="icon-credit-card bigger-110"></i>
                        读卡
                    </button>
                    </if>


                </div>
            </div>
        </form>
    </div>
    <div style="display:none;">
        <object id="CardReader1" codebase="./FirstActivex.cab#version=1,0,3,1" classid="CLSID:F225795B-A882-4FBA-934C-805E1B2FBD1B">
            <param name="_Version" value="65536" /><param name="_ExtentX" value="2646" />
            <param name="_ExtentY" value="1323" /><param name="_StockProps" value="0" />
            <param name="port" value="\u4e32\u53e31" /><param name="PhotoPath" value="" />
            <param name="ActivityLFrom" value="" /><param name="ActivityLTo" value="" />
        </object>
    </div>
    <script type="text/javascript">
        $(function() {
                var obj = document.getElementById("CardReader1");
                obj.setPortNum(1001);
                });
function read() {
    var obj = document.getElementById("CardReader1");
    obj.ReadCard();
    $("#name").val(obj.NameL());
    $("#identity").val(obj.CardNo());
    $("#site").val(obj.Address());
    var sex='';
    if (obj.Sex() == 1) {
        sex='男';
    } else {
        sex='女';
    }
    $("#sex").val(sex);
}
</script>


<include file="Public/ace_footer" />
